package chapter01;

public class obj_02 {
    public static void main(String argv[]) {
        Manager boos = new Manager(35,10000,"张三",5000);
        System.out.println(boos.toString());
    }
}

class Employee
{
    public Employee(){}
    public Employee(int salary,int age,String name){
        this.salary = salary;
        this.age = age;
        this.name = name;
    }
    private double salary;
    private int age;
    private String name;

    public double getSalary() {
        return salary;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "salary=" + salary +
                ", age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}

class Manager extends Employee
{
    public Manager(){}
    public Manager(int salary,int age,String name,double bons){
        super(salary,age,name);
        this.bons = bons;
    }

    public double getBons() {
        return bons;
    }

    public void setBons(double bons) {
        this.bons = bons;
    }

    public double getSalary()
    {
        return super.getSalary() + this.bons;
    }

    @Override
    public String toString() {
        return "Manager{" +
                "bons=" + bons +
                "} " + super.toString();
    }

    private double bons;
}
